import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/container.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:jinke/utils/component/page_state/widgets/widgets.dart';
import 'package:jinke/utils/util.dart';

class ProBaseInfoCell extends StatelessWidget {
  const ProBaseInfoCell({
    super.key,
    required this.title,
    this.items,
  });
  final String title;
  final List<BrnInfoModal>? items;
  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.fromLTRB(16.r, 16.r, 16.r, 0),
      padding: EdgeInsets.fromLTRB(16.r, 0, 16.r, 16.r),
      decoration: BoxDecoration(
          color: Colors.white, borderRadius: BorderRadius.circular(4.r)),
      child: Column(
        children: [
          Container(
            height: 43.r,
            alignment: Alignment.centerLeft,
            decoration: const UnderlineTabIndicator(
                borderSide: BorderSide(color: ColorsUtil.separator)),
            child: Text(
              title,
              style: TextStyle(
                color: ColorsUtil.title,
                fontSize: 16.sp,
                fontWeight: FontWeight.bold,
              ),
            ),
          ),
          SizedBox(
            height: 16.r,
          ),
          isZeroList(items)
              ? EmptyView()
              : BrnPairInfoTable(
                  children: items!,
                  itemSpacing: 10.r,
                  rowDistance: 10.r,
                ),
        ],
      ),
    );
  }
}
